import request from '../../utils/request';

// 文章评论相关 API

// 审核评论
export const auditComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/audit',
        method: 'post',
        data
    });
};

// 获取文章评论统计
export const getArticleCommentCount = (params: any) => {
    return request({
        url: '/content/api/article-comment/count',
        method: 'get',
        params
    });
};

// 创建评论
export const createComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/create',
        method: 'post',
        data
    });
};

// 删除评论
export const deleteComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/delete',
        method: 'delete',
        data
    });
};

// 查询评论详情
export const getCommentDetail = (params: any) => {
    return request({
        url: '/content/api/article-comment/detail',
        method: 'get',
        params
    });
};

// 点赞评论
export const likeComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/like',
        method: 'post',
        data
    });
};

// 查询评论列表
export const getCommentList = (data: any) => {
    return request({
        url: '/content/api/article-comment/list',
        method: 'post',
        data
    });
};

// 分页查询评论
export const getCommentPage = (params: any) => {
    return request({
        url: '/content/api/article-comment/page',
        method: 'get',
        params
    });
};

// 置顶评论
export const topComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/top',
        method: 'post',
        data
    });
};

// 取消点赞评论
export const unlikeComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/unlike',
        method: 'post',
        data
    });
};

// 取消置顶评论
export const untopComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/untop',
        method: 'post',
        data
    });
};

// 更新评论
export const updateComment = (data: any) => {
    return request({
        url: '/content/api/article-comment/update',
        method: 'put',
        data
    });
};
